//index.js
//获取应用实例
var util = require('../../utils/util.js');
var app = getApp();

Page({
  data: {
    articleInfo: {},
    hunterInfo: {},
  },
  onShow: function () {
    wx.showToast({
      title: '加载中',
      icon: 'loading',
      duration: 500
    })
    setTimeout(function () {
      wx.hideToast()
    }, 500);
  },
  onLoad: function (options) {
    var hunterid = options.hunterid;
    console.log("stoiire详情id获取=" + hunterid)
    var that = this;

    util.post(app.api.getHunterDetail, { hunterid: hunterid }, function (res) {
      //获取猎头详情
      that.setData({
        hunterInfo: res.data
      });
      wx.setNavigationBarTitle({
        title: that.data.hunterInfo.name + "-精选文章"//页面标题为路由参数
      })
    });

    util.post(app.api.getHunterArticles, { hunterid: hunterid }, function (res) {
      //获取文章
      that.setData({
        articleInfo: res.data
      });
    });
  },
  /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
  onPullDownRefresh: function () {

  },
  /**
* 页面上拉触底事件的处理函数
*/
  onReachBottom: function () {

  },

})
